<template>
<!-- 系统用户管理 -->
    <div class="page">
        <section class="select">
            <module-seleclt></module-seleclt>
        </section>
        <section class="table">
            <manage-pubilc-table :el_tableData="tableData">
                <template slot="buttonTable">
                    <el-button style="float: right;" ><router-link :to="{path:'/edit_system_user'}">添加</router-link></el-button>
                </template>
                <template slot="tableShow" >
                    <el-table-column align="center" v-for="item in tableShow" :key="item.index"  :prop="item.prop"  :label="item.label"></el-table-column>
                    <el-table-column align="center" label="操作" width="180">
                        <template>
                            <el-button type="text" size="small" @click="handle_edit_page(scope.row)">编辑</el-button>
                            <el-button type="text" size="small" @click="handle_stop_page(scope.row.id,scope.$index)">启用</el-button>
                            <el-button type="text" size="small" @click="handle_stop_page(scope.row.id,scope.$index)">停用</el-button>
                            <el-button type="text" size="small">重置密码</el-button>
                        </template>
                    </el-table-column>
                </template>
            </manage-pubilc-table>
        </section>
        <section class="pagination">
            <manage-pubilc-pagination :el_pagination="pagination" @el-handleSizeChange="handleSizeChange" @el-handleCurrentChange="handleCurrentChange"></manage-pubilc-pagination>
        </section>
    </div>
</template>
<script>
import moduleSeleclt from "./module/select.vue"
import pubilcPaginationMinxin from "manage-sys-libs/src/components/managePubilcPagination/mixins/index"
export default {
    mixins: [pubilcPaginationMinxin],
    components:{
        moduleSeleclt,
    },
    data(){
        return{
            tableShow:[
                {index:0,prop:"id",label:"编号"},
                {index:1,prop:"date",label:"所属机构"},
                {index:2,prop:"name",label:"姓名"},
                {index:3,prop:"sex",label:"性别"},
                {index:4,prop:"mobile",label:"手机号"},
                {index:5,prop:"username",label:"登录名"},
                {index:6,prop:"rolename",label:"角色"},
                {index:7,prop:"enabled",label:"状态"},
            ],
            tableData: [
                {}
            ],
            pagination:{
                total:1,
                pageSize:10,
                currentPage4:1
            }

        }
    },
    methods:{
        // 获取列表
        getlist(val){
            this.tableData = val;
        },
        // 点击编辑页面
        handle_edit_page(row){
            // 存入vuex
            this.$store.dispatch("system/list_system_userListItem",row);
            // 打开编辑页面
            this.$router.push({path:'/edit_organization',query:{type:"edit"}})
        },
        // 点击是否显示直接修改状态
        handle_edit_show(row){
            // let data = {
            //     id:row.id,
            //     enable:row.enable
            // }
            // this.$store.dispatch("organization/updateshow_organizationAddObj",data)            
        },
        //点击停用
        handle_stop_page(val,index){
        //     this.$store.dispatch("organization/delete_organizationAddObj",{id:val})
        //     .then(res=>{
        //        if(res){
                   
        //        }
        //    })
        }
    }
}
</script>